﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class index : System.Web.UI.Page
{
    AccessDAO dao = new AccessDAO();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.Button1.Attributes.Add("onclick","javascript:show();");

            string fw = "update fw set num=num+1 where id=1";
            dao.getComm(fw);

            showGsNew();
            showFg();
            showDb();
            showHy();

            string s1 = "select top 5 * from xzMessage order by id desc";
            DataSet ds1 = dao.getDs(s1);
            this.reXz.DataSource = ds1;
            this.reXz.DataBind();

            string s2 = "select * from billInfo where id=1";
            DataSet ds2 = dao.getDs(s2);
            this.dlProdu.DataSource = ds2;
            this.dlProdu.DataBind();

            string s3 = "select * from billInfo where id=2";
            DataSet ds3 = dao.getDs(s3);
            this.DataList1.DataSource = ds3;
            this.DataList1.DataBind();
        }
    }

    //协会公告
    private void showGsNew()
    {
        string ss = "select top 6 * from newMessage where typename='协会公告' order by id desc";
        DataSet ds = dao.getDs(ss);
        this.reGsNew.DataSource = ds;
        this.reGsNew.DataBind();
    }

    //行业动态
    private void showHy()
    {
        string ss = "select top 6 * from newMessage where typename='行业动态' order by id desc";
        DataSet ds = dao.getDs(ss);
        this.reHy.DataSource = ds;
        this.reHy.DataBind();
    }

    //展会信息
    private void showDb()
    {
        string ss = "select top 6 * from zhanhui order by id desc";
        DataSet ds = dao.getDs(ss);
        this.reDb.DataSource = ds;
        this.reDb.DataBind();
    }


    //政策法规
    private void showFg()
    {
        string ss = "select top 6 * from zhengce order by id desc";

        //string ss = "select top 6 * from newMessage where messId=4 order by id desc";
        DataSet ds = dao.getDs(ss);
        this.Repeater1.DataSource = ds;
        this.Repeater1.DataBind();
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        string name =this.RadioButtonList1.Text.ToString();
        string ss = "update online set num=num+1 where name='"+name+"'";
        dao.getComm(ss);
    }
}

